home *** CD-ROM | disk | FTP | other *** search
- Path: menkar.cs.utk.edu!doolin
- From: doolin@menkar.cs.utk.edu (David Doolin)
- Newsgroups: comp.lang.c
- Subject: dlist; *not* homework!
- Date: 28 Feb 1996 23:04:54 GMT
- Organization: Computer Science Dept, University of Tennessee, Knoxville
- Distribution: world
- Message-ID: <4h2n2mINN2sm@CS.UTK.EDU>
- NNTP-Posting-Host: menkar.cs.utk.edu
-
-
- Disclaimer: The following pertains to code I am writing to
- investigate the validity of an analytic solution I developed
- for MS level work in Civil Engineering.
-
- I need to take two sorted double linked lists, and merge
- them into one sorted list. I have at my
- disposal: Usenet, the Cfaq, working dlist code (part of which
- I wrote, part of which I have linked in). What I don't have
- is an algorithm.
-
- Here are some specifics. The dlist consists of a head node
- with front and back pointers that initially point to itself.
- I can insert at either the front or back, or between any node.
- I can also insert an entire list if necessary. The structure
- of the program consists of a main dlist with a sub dlist attached
- at each main node. All node values are initially cast as a null pointer,
- which I recast according to use: to a structure pointer for the
- sublist, to a dlist pointer for the main list. I have already
- written the traversal routines, which work well. Restated,
- I want to sort the values of two already sorted doubly linked lists.
-
- I would *love* to get a compilable piece of source for this,
- but I would settle for an algorithm, preferably in pseudo-code
- (LaTeX!). Actually, even an appropriate library reference would
- be nice.
-
- If this sounds too suspiciously like _homework_, I would happily
- spend several hours boring anyone to tears about the significance
- and ramifications of the analytic solutions. I also have
- some fascinating (!) papers available!
-
- Many thanks,
- Dave Doolin
- doolin@cs.utk.edu
-
- ps. Consider it a work of charity: increasing the use and literacy
- of C in the Civil Engineering community!
-